<?php namespace module\news;

class Process {
	public function handler( $kid ) {
		$data = Db::table( 'reply_news' )->where( 'kid', $kid )->get();
		$reply=[];
		foreach ($data as $k => $v) {
			if (empty($v['url'])) {
				$v['url']=web_url('site/show','news',['id'=>$v['id']]);
			}
			$res['Title']=$v['title'];
			$res['Description']=$v['description'];
			$res['PicUrl']=__ROOT__.'/'.$v['thumb'];
			$res['Url']=$v['url'];
			$reply[]=$res;
		}
		Wx::instance('message')->news($reply);
	}
}